3D User Interfaces and 3D App Building Using the Chrome Library Set of Behaviors
Table of Contents
- Introduction
- Setting Up the Texture Render Format
- Setting Up Hardware Anti-Aliasing (FSAA)
- Setting Up the Shader Blend Level for Reflection
- Opening and Closing the Movable Parts of the Car
- Creating a UI on Top of the 3D Scene
- Changing the Camera
- Creating a 3D Navigation System for a Website
- Controlling Flash from Shockwave 3D
- Afterword and Conclusion
Opening and Closing the Movable Parts of the Car
You want the user to be able to open and close the movable parts of the car, namely the hood, the trunk, the doors, and the seats. This is simple as you only have to care about the rotation on one axis. The pivot point of each separate model of the car has already been set in 3DS Max, so all movable parts rotate correctly about their axes.
| Hood | Target Y axis rotation : 50.00 |
|---|---|
| Trunk | Target Y axis rotation : -65.00 |
| Front seat left | Target Y axis rotation : 20.00 |
| Front seat right | Target Y axis rotation : 20.00 |
| Front door left | Target Z axis rotation : -75.00 |
| Front door right | Target Z axis rotation : 75.00 |
| Rear door left | Target Z axis rotation : -75.00 |
| Rear door right | Target Z axis rotation : 75.00 |
-
Drag and drop the Open/Close Model behavior from the Chrome Lib onto the W3D sprite, either on the Stage or in the Score.
Figure 9. The Open/Close Model behavior
The following dialog box appears:
Figure 10. The Open/Close Model parameters dialog box
- Select the model you want to manipulate.
-
Make sure the Copy Position parameter is checked and enter the correct rotation on the relevant axis, for example, 20 degrees on the Y axis for the Front Seat Right model.
If the sliders are too touchy for you, enter precise values in the behavior tab of the Property inspector:
Figure 11. The Property inspector showing the Open/Close model behavior
You must create an instance of the behavior for each model you want to open/close. In this case, you would have to drag and drop the same behavior eight times, each time with a different set of parameters (that is, a different model, axis, and rotation value).
Click the Play button in the Control panel or press Enter to start the movie. Click the hood, the trunk, the doors, or the seats, and they open in a smooth, progressive way. Click them again, and they will close in the same way. You can interrupt the opening or closing of a movable part while it rotates by clicking it, and it will immediately start rotating in the opposite direction. The rotation boundaries on the axis are defined by the original rotation and by the set target rotation behavior.
Figure 12. The car with the hood and the driver door open